﻿using Nuwanda.Common;
using StructureMap;
using StructureMap.Attributes;

namespace Nuwanda.TfsSpotlight.Shell.Services.Interfaces
{
    /// <summary>Uses XML serialization to persist objects</summary>
    [Author("Bartłomiej Legiędź")]
    [PluginFamily("IsolatedStorageService", Scope = InstanceScope.Singleton)]
    public interface IIsolatedStorageService
    {
        /// <summary>Saves given entity to the user store</summary>
        /// <typeparam name="T">Type of the entity to save</typeparam>
        /// <param name="entity">Entity to save</param>
        /// <param name="fileName">Name for a file</param>
        void Save<T>(T entity, string fileName);

        /// <summary>Loads entity from user store</summary>
        /// <typeparam name="T">Type of the entity to load</typeparam>
        /// <param name="fileName">Name of the file containing the entity</param>
        /// <returns>An instance of the entity</returns>
        T Load<T>(string fileName);
    }
}